<template>
  <!-- <input class="uni-input" @input="onKeyInput" :placeholder='inputObj.placeholder' /> -->
  <u-input
    v-model="value"
    :type="type"
    :border="border"
    :placeholder="inputObj.placeholder?inputObj.placeholder:'请输入信息'"
    :disabled="disabled"
  />
</template>

<script>
export default {
  props: {
    formObj: {
      type: Object,
    },
  },

  data() {
    return {
      name: "",
      inputObj: {},
      value: "",
      type: "text",
      border: false,
      disabled: false,
    };
  },

  mounted() {
    this.inputObj = this.formObj;
    this.formObj.value ? (this.disabled = true) : (this.disabled = false);
    this.value = this.formObj.value;
	console.log(this.formObj.placeholder)
  
  },

  watch: {
    value(newValue, oldValue) {
     
      var obj = {
        key: this.inputObj.name,
        value: newValue,
      };
      this.$emit("childFn", obj);
    },
    deep: true
  },
  methods: {
    // onKeyInput(e){
    //     name = e.target.value
    //     var obj = {
    //         key: this.inputObj.name,
    //         value: e.target.value
    //     }
    //     this.$emit('childFn',obj)
    // },
  },
};
</script>


<style lang="less" scoped>
</style>